Deleted unused files.
[Sonic-Engine-360.git] / GMS2 / Sonic Engine 360 / options / windows / RunnerInstaller.nsi
blobcd77b58218ecc9ee754d07acdc2b97471bc2a6cf
1 ; RunnerInstaller.nsi
3 ; This script is based on example1.nsi, but it remember the directory,
4 ; has uninstall support and (optionally) installs start menu shortcuts.
6 ; It will install example2.nsi into a directory that the user selects,
8 ;--------------------------------
9 !include MUI2.nsh
11 !ifndef FULL_VERSION
12 !define FULL_VERSION "1.0.0.0"
13 !endif
14 !ifndef SOURCE_DIR
15 !define SOURCE_DIR "C:\source\temp\InstallerTest\runner"
16 !endif
17 !ifndef INSTALLER_FILENAME
18 !define INSTALLER_FILENAME "C:\source\temp\InstallerTest\RunnerInstaller.exe"
19 !endif
21 !ifndef MAKENSIS
22 !define MAKENSIS "%appdata%\GameMaker-Studio\makensis"
23 !endif
25 !ifndef COMPANY_NAME
26 !define COMPANY_NAME ""
27 !endif
29 !ifndef COPYRIGHT_TXT
30 !define COPYRIGHT_TXT "(c)Copyright 2013"
31 !endif
33 !ifndef FILE_DESC
34 !define FILE_DESC "Created with GameMaker:Studio"
35 !endif
37 !ifndef LICENSE_NAME
38 !define LICENSE_NAME "License.txt"
39 !endif
41 !ifndef ICON_FILE
42 !define ICON_FILE "icon.ico"
43 !endif
45 !ifndef IMAGE_FINISHED
46 !define IMAGE_FINISHED "Runner_finish.bmp"
47 !endif
49 !ifndef IMAGE_HEADER
50 !define IMAGE_HEADER "Runner_header.bmp"
51 !endif
53 !ifndef PRODUCT_NAME
54 !define PRODUCT_NAME "Runner"
55 !endif
57 !define APP_NAME "${PRODUCT_NAME}"
58 !define SHORT_NAME "${PRODUCT_NAME}"
60 !ifndef EXE_NAME
61 !define EXE_NAME "${PRODUCT_NAME}"
62 !endif
65 ;;USAGE:
66 !define MIN_FRA_MAJOR "2"
67 !define MIN_FRA_MINOR "0"
68 !define MIN_FRA_BUILD "*"
70 !addplugindir "."
72 ;--------------------------------
74 ; The name of the installer
75 Name "${APP_NAME}"
76 Caption "${APP_NAME}"
77 BrandingText "${APP_NAME}"
79 ; The file to write
80 OutFile "${INSTALLER_FILENAME}"
82 ; The default installation directory
83 InstallDir "$PROFILE\${APP_NAME}"
85 ; Registry key to check for directory (so if you install again, it will
86 ; overwrite the old one automatically)
87 InstallDirRegKey HKCU "Software\Runner" "Install_Dir"
89 ; Request application privileges for Windows Vista
90 RequestExecutionLevel admin
93 VIProductVersion "${FULL_VERSION}"
94 VIAddVersionKey /LANG=1033 "FileVersion" "${FULL_VERSION}"
95 VIAddVersionKey /LANG=1033 "ProductVersion" "${FULL_VERSION}"
96 VIAddVersionKey /LANG=1033 "ProductName" "${PRODUCT_NAME}"
97 VIAddVersionKey /LANG=1033 "CompanyName" "${PRODUCT_PUBLISHER}"
98 VIAddVersionKey /LANG=1033 "LegalCopyright" "${COPYRIGHT_TXT}"
99 VIAddVersionKey /LANG=1033 "FileDescription" "${FILE_DESC}"
103 !define MUI_HEADERIMAGE
104 !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
105 !define MUI_ICON "${ICON_FILE}"
106 !define MUI_WELCOMEFINISHPAGE_BITMAP "${IMAGE_FINISHED}"
107 !define MUI_HEADERIMAGE_BITMAP "${IMAGE_HEADER}"
108 !define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
111 ;--------------------------------
113 ; Pages
114 !insertmacro MUI_PAGE_LICENSE "${LICENSE_NAME}"
115 !insertmacro MUI_PAGE_COMPONENTS
116 !insertmacro MUI_PAGE_DIRECTORY
117 !insertmacro MUI_PAGE_INSTFILES
118 # These indented statements modify settings for MUI_PAGE_FINISH
119 !define MUI_FINISHPAGE_NOAUTOCLOSE
120 !define MUI_FINISHPAGE_RUN_TEXT "Start ${PRODUCT_NAME}"
121 !define MUI_FINISHPAGE_RUN "$INSTDIR\${EXE_NAME}.exe"
122 !insertmacro MUI_PAGE_FINISH
124 Var DirectXSetupError
126 UninstPage uninstConfirm
127 UninstPage instfiles
129 !insertmacro MUI_LANGUAGE "English"
130 ;--------------------------------
132 ; The stuff to install
133 Section `${APP_NAME}`
134 SectionIn RO
136 ; Set output path to the installation directory.
137 SetOutPath $INSTDIR
139 ; Put file there
140 File "${LICENSE_NAME}"
141 File /r "${SOURCE_DIR}\*.*"
143 ; Write the uninstall keys for Windows
144 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORT_NAME}" "DisplayName" "${APP_NAME}"
145 WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORT_NAME}" "UninstallString" '"$INSTDIR\uninstall.exe"'
146 WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORT_NAME}" "NoModify" 1
147 WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORT_NAME}" "NoRepair" 1
148 WriteUninstaller "uninstall.exe"
150 SectionEnd
152 ; Optional section (can be disabled by the user)
153 Section "Start Menu Shortcuts"
155 CreateDirectory "$SMPROGRAMS\${APP_NAME}"
156 CreateShortCut "$SMPROGRAMS\${APP_NAME}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
157 CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME}.lnk" "$INSTDIR\${EXE_NAME}.exe" "" "$INSTDIR\${EXE_NAME}.exe"
158 CreateShortCut "$SMPROGRAMS\${APP_NAME}\${APP_NAME} License.lnk" "notepad.exe" "$INSTDIR\License.txt"
160 SectionEnd
163 ; Optional section (can be enabled by the user)
164 Section /o "Desktop shortcut"
166 CreateShortCut "$DESKTOP\${APP_NAME}.lnk" "$INSTDIR\${EXE_NAME}.exe" ""
168 SectionEnd
171 ;--------------------------------
173 ; Uninstaller
175 Section "Uninstall"
176 ; Remove registry keys
177 DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SHORT_NAME}"
179 ; Remove files and uninstaller (everything)
180 RMDir /r "$INSTDIR"
182 ; Remove desktop icon
183 Delete "$DESKTOP\${APP_NAME}.lnk"
185 ; Remove shortcuts, if any
186 Delete "$SMPROGRAMS\${APP_NAME}\*.*"
188 ; Remove directories used
189 RMDir "$SMPROGRAMS\${APP_NAME}"
190 RMDir "$INSTDIR"
192 SectionEnd
195 ;--------------------------------
197 ; This should be the LAST section available....
199 Section "DirectX Install" SEC_DIRECTX
201 SectionIn RO
203 SetOutPath "$TEMP"
204 File "${MAKENSIS}\dxwebsetup.exe"
205 DetailPrint "Running DirectX Setup..."
206 ExecWait '"$TEMP\dxwebsetup.exe" /Q' $DirectXSetupError
207 DetailPrint "Finished DirectX Setup"
209 Delete "$TEMP\dxwebsetup.exe"
211 SetOutPath "$INSTDIR"
213 SectionEnd